home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1989 February
/
Ahoy_Magazine_89-02_1989_Double_L.d64
/
Pigs & Cows
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
372b
|
16 lines
1 rem =================================
2 rem
3 rem $80 pigs & $130 cows
4 rem (brute force method)
5 rem
6 rem rupert report #62
7 rem
9 rem =================================
10 print "[147]$80 pigs and $130 cows total $1000": print
20 for p=1 to 1000
30 for c=1 to 1000
40 amt = 80*p + 130*c
50 if amt=1000 then print "solution: ";p; "pigs &"; c; "cows"
60 next c
70 next p